//
//  XYJLanguageChangeTableViewCell.m
//  徙游记-01
//
//  Created by hcios on 2017/7/19.
//  Copyright © 2017年 鹿林. All rights reserved.
//

#import "XYJLanguageChangeTableViewCell.h"

@implementation XYJLanguageChangeTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _languageLabel = [[UILabel alloc] init];
        _selectedImage = [[UIImageView alloc] init];
        [self addSubview:_languageLabel];
        [self addSubview:_selectedImage];
    }
    return self;
}


-(void)layoutWithLanguageLabelText:(NSString *)LanguageText isImage:(BOOL)isImage{
    [_selectedImage setFrame:CGRectMake(5, 10, 20, 20)];
    _selectedImage.backgroundColor = [UIColor redColor];
    _selectedImage.layer.cornerRadius = 10;
    _selectedImage.layer.masksToBounds = YES;
    _selectedImage.hidden = !isImage;
    [self addSubview:_selectedImage];
    
    [_languageLabel setFrame:CGRectMake(CGRectGetMaxX(_selectedImage.frame) + 10, 10, self.frame.size.width - 30, 20)];
    _languageLabel.text = LanguageText;
    _languageLabel.textAlignment = NSTextAlignmentLeft;
    [_languageLabel setFont:[UIFont fontWithName:FONT_NAME_LTH size:15]];
    [_languageLabel setTintColor:[UIColor blackColor]];
    [self addSubview:_languageLabel];
}



@end
